package com.tanhua.admin.controller;

import com.tanhua.admin.service.ManagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/manage")
public class ManagesController {

    @Autowired
    private ManagesService managesService;

    /**
     * 动态通过
     * POST  /messages/pass
     * Body  string[]
     */
    @PostMapping("/messages/pass")
    public ResponseEntity messagesPass(@RequestBody String[] param) {
        String movementIds = param[0];
        return managesService.messagesPass(movementIds);
    }


    /**
     * 动态拒绝
     * PSOT  /messages/reject
     * Body  string[]
     */
    @PostMapping("/messages/reject")
    public ResponseEntity messagesReject(@RequestBody String[] param) {
        String movementIds = param[0];
        return managesService.messagesReject(movementIds);

    }

}
